home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Cookie / remove-ads.izs < prev    next >
Text File  |  2005-09-28  |  6KB  |  245 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Remove Ads 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Catches all clicks on ads and writes a cookie on the visitor's computer. Until the cookie expires, no ads are shown. <!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>cookies<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL REMOVE ADS:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23. <!-- Original:  Adremover (adremover@portalen.no) -->
  24. <!-- Web Site:  http://adremover.vr9.com/ -->
  25.  
  26.  
  27. <!-- Begin
  28. // NB! You must manually change the value 
  29. //     of the following adlink variable!
  30. //
  31. // Unique part of the ad link(s), i.e., 
  32. // if the ad-link is www.myadvertiser.com,
  33. // you can use "myadvertiser":
  34. //
  35. var adlink="change this text!";
  36. //
  37. // Time in seconds until the ads come back
  38. // (default 24 hours):
  39. //
  40. var timeout=60*60*24;
  41.  
  42. // Do not change anything in the code below:
  43. var showads = 1;
  44. function adMessage(adcode) {
  45. if (document.cookie == "") {
  46. document.write(adcode);
  47. } else {
  48. var the_cookie = document.cookie;
  49. the_cookie = unescape(the_cookie);
  50. the_cookie_split = the_cookie.split(";");
  51. for (loop=0;loop<the_cookie_split.length;loop++) {
  52. var part_of_split = the_cookie_split[loop];
  53. var find_name = part_of_split.indexOf("ad");
  54. if (find_name!=-1) {
  55. break;
  56.    }
  57. }
  58. if (find_name==-1) {
  59. document.write(adcode);
  60. } else {
  61. var ad_split = part_of_split.split("=");
  62. var last = ad_split[1];
  63. if (last!=0) {
  64. document.write(adcode);
  65. } else {
  66. showads=0;
  67.          }
  68.       }
  69.    }
  70. }
  71. function writeCookie(show) {
  72. var today = new Date();
  73. var the_date = new Date();
  74. the_date.setTime(today.getTime() + 1000 * timeout);
  75. var the_cookie_date = the_date.toGMTString();
  76. var the_cookie = "ad="+show;
  77. var the_cookie = the_cookie + ";expires=" + the_cookie_date;
  78. document.cookie = the_cookie;
  79. location.reload(true);
  80. }
  81. function handleClick(evnt) {
  82. var targetstring = new String(evnt.target);
  83. if (targetstring.search(adlink) != -1) {
  84. writeCookie(0);
  85. }
  86. routeEvent(evnt);
  87. return true;
  88. }
  89. if (window.Event) {
  90. window.captureEvents(Event.CLICK);
  91. }
  92. window.onClick = handleClick;
  93. adMessage('');
  94. //  End -->
  95. </script>
  96.  
  97. </HEAD>
  98.  
  99. <!-- STEP TWO: Add code into BODY section of document  -->
  100.  
  101. <BODY>
  102.  
  103. <span onClick="writeCookie(0)">
  104. <script language="javascript">
  105. <!--
  106. adMessage('<a href="http://www.evrsoft.com" target="_blank">Example Ad</a>');
  107. // -->
  108. </script>
  109. </span>
  110. <br>
  111. <script language="javascript" TYPE="text/javascript">
  112. if (showads) {
  113. document.write("Remove the ad by clicking it.")
  114. }
  115. </script>
  116. <!-- Optional To Show Ads Again -->
  117. <script language="javascript" TYPE="text/javascript">
  118. if (!showads) {
  119. document.write("<form><input type=button value='Ads back' onClick=writeCookie(1)><\/form>")
  120. }
  121. </script>
  122.  
  123. <!-- END OF SCRIPT -->
  124. <!/SCRIPT>
  125.  
  126. <!PREVIEW>
  127. <!-- START OF SCRIPT -->
  128.  
  129.  
  130. <!-- HOW TO INSTALL REMOVE ADS:
  131.  
  132.   1.  Copy code into the HEAD section of document
  133.   2.  Put last coding into the BODY section of document  -->
  134.  
  135. <!-- STEP ONE: Add code into HEAD section of document  -->
  136.  
  137. <HEAD>
  138.  
  139. <SCRIPT LANGUAGE="JavaScript">
  140. <!-- Original:  Adremover (adremover@portalen.no) -->
  141. <!-- Web Site:  http://adremover.vr9.com/ -->
  142.  
  143.  
  144. <!-- Begin
  145. // NB! You must manually change the value 
  146. //     of the following adlink variable!
  147. //
  148. // Unique part of the ad link(s), i.e., 
  149. // if the ad-link is www.myadvertiser.com,
  150. // you can use "myadvertiser":
  151. //
  152. var adlink="change this text!";
  153. //
  154. // Time in seconds until the ads come back
  155. // (default 24 hours):
  156. //
  157. var timeout=60*60*24;
  158.  
  159. // Do not change anything in the code below:
  160. var showads = 1;
  161. function adMessage(adcode) {
  162. if (document.cookie == "") {
  163. document.write(adcode);
  164. } else {
  165. var the_cookie = document.cookie;
  166. the_cookie = unescape(the_cookie);
  167. the_cookie_split = the_cookie.split(";");
  168. for (loop=0;loop<the_cookie_split.length;loop++) {
  169. var part_of_split = the_cookie_split[loop];
  170. var find_name = part_of_split.indexOf("ad");
  171. if (find_name!=-1) {
  172. break;
  173.    }
  174. }
  175. if (find_name==-1) {
  176. document.write(adcode);
  177. } else {
  178. var ad_split = part_of_split.split("=");
  179. var last = ad_split[1];
  180. if (last!=0) {
  181. document.write(adcode);
  182. } else {
  183. showads=0;
  184.          }
  185.       }
  186.    }
  187. }
  188. function writeCookie(show) {
  189. var today = new Date();
  190. var the_date = new Date();
  191. the_date.setTime(today.getTime() + 1000 * timeout);
  192. var the_cookie_date = the_date.toGMTString();
  193. var the_cookie = "ad="+show;
  194. var the_cookie = the_cookie + ";expires=" + the_cookie_date;
  195. document.cookie = the_cookie;
  196. location.reload(true);
  197. }
  198. function handleClick(evnt) {
  199. var targetstring = new String(evnt.target);
  200. if (targetstring.search(adlink) != -1) {
  201. writeCookie(0);
  202. }
  203. routeEvent(evnt);
  204. return true;
  205. }
  206. if (window.Event) {
  207. window.captureEvents(Event.CLICK);
  208. }
  209. window.onClick = handleClick;
  210. adMessage('');
  211. //  End -->
  212. </script>
  213.  
  214. </HEAD>
  215.  
  216. <!-- STEP TWO: Add code into BODY section of document  -->
  217.  
  218. <BODY>
  219.  
  220. <span onClick="writeCookie(0)">
  221. <script language="javascript">
  222. <!--
  223. adMessage('<a href="http://www.evrsoft.com" target="_blank">Example Ad</a>');
  224. // -->
  225. </script>
  226. </span>
  227. <br>
  228. <script language="javascript" TYPE="text/javascript">
  229. if (showads) {
  230. document.write("Remove the ad by clicking it.")
  231. }
  232. </script>
  233. <!-- Optional To Show Ads Again -->
  234. <script language="javascript" TYPE="text/javascript">
  235. if (!showads) {
  236. document.write("<form><input type=button value='Ads back' onClick=writeCookie(1)><\/form>")
  237. }
  238. </script>
  239.  
  240.  
  241. <!-- END OF SCRIPT -->
  242. <!/PREVIEW>
  243.  
  244. <!RELATED>NONE<!/RELATED>
  245.